package com.leetcode.LC;

public class LC867 {
    public int[][] transpose(int[][] A) {

        int[][] ints = new int[A[0].length][A.length];
        for (int i = 0; i < A.length; i++) {
            for (int j = 0; j < A[0].length; j++) {
                ints[j][i] = A[i][j];
            }
        }
        return ints;
    }

    public static void main(String[] args) {
        for (int[] ints : new LC867().transpose(new int[][]{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}})) {
            for (int anInt : ints) {
                System.out.print(anInt + " ");
            }
            System.out.println();
        }
    }
}
